import http from '@/common/http.js'

export async function getVlogcate() { //获取二级栏目列表
	return await http({
		url: '/vlog/list',
		method: 'GET'
	})
}
export async function getStore(data) { //根据二级栏目ID获取门店列表
	return await http({
		url: '/vlog/store/' + data.id,
		method: 'GET'
	})
}
export async function createVlog(data) { //用户发布作品
	return await http({
		url: '/vlog/create',
		method: 'POST',
		data: data
	})
}
export async function getVloglist() { //获取用户作品列表
	return await http({
		url: '/vlog/userVlogs',
		method: 'GET'
	})
}
export async function getVlogdetail(data) { //根据ID获取作品详情
	return await http({
		url: '/vlog/get/' + data.id,
		method: 'GET'
	})
}
export async function delVlog(data) { //根据ID删除作品
	return await http({
		url: '/vlog/del/' + data.id,
		method: 'DELETE'
	})
}
export async function getWanhome() { //趣玩主页
	return await http({
		url: '/tour/homePage',
		method: 'GET'
	})
}
export async function gethotVlogs(data) { //热门旅游作品
	return await http({
		url: '/tour/hotVlogs',
		method: 'GET',
		data: data
	})
}
export async function getWanlist(data) { //获取类型下作品列表
	return await http({
		url: '/tour/type/' + data.id,
		method: 'GET',
		data: data
	})
}
export async function getDraft(data) { //获取用户草稿作品列表
	return await http({
		url: '/vlog/draft',
		method: 'GET'
	})
}

export async function getFoodhome(data) { //获取美食首页信息
	return await http({
		url: '/store/cateHomePage',
		method: 'GET',
		data: data
	})
}
export async function getStorelist(data) { //根据类型ID获取门店列表
	return await http({
		url: '/store/infos/' + data.id,
		method: 'GET',
		data: {
			longitude: data.longitude,
			latitude: data.latitude
		}
	})
}
export async function getStorelist2(data) { //根据类型ID获取门店列表
	return await http({
		url: '/store/type/' + data.id,
		method: 'GET',
		data: {
			longitude: data.longitude,
			latitude: data.latitude,
			pageSize: data.pageSize,
			pageNum: data.pageNum
		}
	})
}
export async function getStoreinfo(data) { //根据ID获取门店详情
	return await http({
		url: '/store/info/' + data.id,
		method: 'GET',
		data: {
			longitude: data.longitude,
			latitude: data.latitude
		}
	})
}
export async function releaseVlog(data) { //用户发布作品
	return await http({
		url: '/vlog/release/' + data.id,
		method: 'GET'
	})
}
export async function updateVlog(data) { //用户修改草稿作品
	return await http({
		url: '/vlog/update',
		method: 'POST',
		data: data
	})
}
export async function getComment(data) { //根据作品ID查询作品评论
	return await http({
		url: '/vlog/getComment/' + data.id,
		method: 'GET',
		data: {
			pageNum: data.pageNum,
			pageSize: data.pageSize,
			classify: data.classify || '2'
		}
	})
}
export async function addComment(data) { //用户发表作品评论
	return await http({
		url: '/vlog/addComment',
		method: 'POST',
		data: data
	})
}
export async function commentLike(data) { //用户给评论点赞
	return await http({
		url: '/vlog/like/' + data.id,
		method: 'GET'
	})
}

export async function commentDel(data) { //用户删除评论
	return await http({
		url: '/vlog/delComment/' + data.id,
		method: 'GET'
	})
}